package com.zkthink.ceres.order.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.zkthink.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.zkthink.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 平台介入表
 * </p>
 *
 * @author JustArgo
 * @since 2020-07-05
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_return_intervention")
@ApiModel(value = "ReturnIntervention", description = "平台介入表")
@AllArgsConstructor
public class ReturnIntervention extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("商户id")
    @TableField("tenant_code")
    private String tenantCode;

    /**
     * 售后类型 1-退款 2-退货退款
     */
    @ApiModelProperty(value = "售后类型 1-退款 2-退货退款")
    @NotNull(message = "售后类型 1-退款 2-退货退款不能为空")
    @TableField("return_type")
    @Excel(name = "售后类型 1-退款 2-退货退款")
    private Integer returnType;

    /**
     * 售后单编号
     */
    @ApiModelProperty(value = "售后单编号")
    @NotEmpty(message = "售后单编号不能为空")
    @Length(max = 20, message = "售后单编号长度不能超过20")
    @TableField(value = "return_code", condition = LIKE)
    @Excel(name = "售后单编号")
    private String returnCode;

    /**
     * 子订单编号
     */
    @ApiModelProperty(value = "子订单编号")
    @NotEmpty(message = "子订单编号不能为空")
    @Length(max = 32, message = "子订单编号长度不能超过32")
    @TableField(value = "order_code", condition = LIKE)
    @Excel(name = "子订单编号")
    private String orderCode;

    /**
     * 举证说明
     */
    @ApiModelProperty(value = "举证说明")
    @NotEmpty(message = "举证说明不能为空")
    @Length(max = 255, message = "举证说明长度不能超过255")
    @TableField(value = "proof_remark", condition = LIKE)
    @Excel(name = "举证说明")
    private String proofRemark;

    /**
     * 举证图片
     */
    @ApiModelProperty(value = "举证图片")
    @NotEmpty(message = "举证图片不能为空")
    @Length(max = 255, message = "举证图片长度不能超过255")
    @TableField(value = "proof_imgs", condition = LIKE)
    @Excel(name = "举证图片")
    private String proofImgs;

    /**
     * 1-处理中 2-同意售后 3-拒绝售后
     */
    @ApiModelProperty(value = "1-处理中 2-同意售后 3-拒绝售后")
    @NotNull(message = "1-处理中 2-同意售后 3-拒绝售后不能为空")
    @TableField("status")
    @Excel(name = "1-处理中 2-同意售后 3-拒绝售后")
    private Integer status;

    /**
     * 审核备注
     */
    @ApiModelProperty(value = "审核备注")
    @NotEmpty(message = "审核备注不能为空")
    @Length(max = 255, message = "审核备注长度不能超过255")
    @TableField(value = "audit_remark", condition = LIKE)
    @Excel(name = "审核备注")
    private String auditRemark;

    /**
     * 逻辑删除 1-删除 0-未删除
     */
    @ApiModelProperty(value = "逻辑删除 1-删除 0-未删除")
    @NotNull(message = "逻辑删除 1-删除 0-未删除不能为空")
    @TableField("is_delete")
    @Excel(name = "逻辑删除 1-删除 0-未删除")
    private Integer isDelete;


    @Builder
    public ReturnIntervention(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime,
                              Integer returnType, String returnCode, String orderCode, String proofRemark, String proofImgs,
                              Integer status, String auditRemark, Integer isDelete) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.returnType = returnType;
        this.returnCode = returnCode;
        this.orderCode = orderCode;
        this.proofRemark = proofRemark;
        this.proofImgs = proofImgs;
        this.status = status;
        this.auditRemark = auditRemark;
        this.isDelete = isDelete;
    }

}
